import { IsNotEmpty, IsString, Length } from 'class-validator';

export class LoginDto {
    password: string;
    @IsNotEmpty({
        message:'用户名不能为空'
    })
    @IsString({
        message:'用户名必须是字符串'
    })
    @Length(6,12,{
        message:'用户名长度必须是6-12位'
    })
    username: string;
  code: any;
}
export class RegisterDto {
       @Length(6,12,{
        message:'密码长度必须是6-12位'
    })
    @IsNotEmpty({
        message:'密码不能为空'
    })
    password: string;
       @IsNotEmpty({
        message:'用户名不能为空'
    })
    @IsString({
        message:'用户名必须是字符串'
    })
    @Length(6,12,{
        message:'用户名长度必须是6-12位'
    })
    username: string;
}